# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper

	def only_for_admin
		if logged_in? && @signed_user.is_admin?
			yield
		end
	end

	def display_sign_action
		if logged_in?
			link_to('&deg;Sign-Out', signout_path)
		else
			"#{link_to('&deg;Sign-In', signin_path)} " +
			"#{link_to('&deg;Create-account', signup_path)}"
		end
	end

	def display_controller_depend_basic_link(name, url, ctrl)
		link_to "&deg;#{name}", url, :class => (params[:controller] == ctrl) ? "hovered" : "basic"
	end

end
